#pragma once

#include "vrdatacore_global.h"
#include "notransformactor.h"
#include <osg\Group>
#include "commonshape.h"
#include "transformable.h"

namespace VrDataCore
{
	class VRDATACORE_EXPORT CollisionPlaneDrawable:public CoreBase::Transformable
	{
	public:
		CollisionPlaneDrawable(CoreBase::ActorBase* owneractor,const QString& name = "CollisionPlaneDrawable");
		virtual void addedToScene(CoreBase::Scene* scene);
		void setControlVertex(const osg::Vec3& start,const osg::Vec3& end);
		void setActive(bool active);
	protected:
		virtual ~CollisionPlaneDrawable();
		osg::ref_ptr<osg::Group>							_root;
		osg::ref_ptr<CoreBase::PlaneShape>					_planeShapeOne;
		//osg::ref_ptr<CoreBase::PlaneShape>					_planeShapeTwo;
		osg::ref_ptr<osg::StateSet>							_ss;
	};

	class VRDATACORE_EXPORT CollisionPlaneActor:public NoTransformActor
	{
	public:
		CollisionPlaneActor();
		void setControlVertex(const osg::Vec3& start,const osg::Vec3& end);
		void getControlVertex(osg::Vec3& start,osg::Vec3& end);
		void setActive(bool active);
		bool getActive();
	protected:
		~CollisionPlaneActor();
	protected:
		virtual void createDrawable();
		bool												_active;
		osg::Vec3											_pointStart;
		osg::Vec3											_pointEnd;
	};
}